package com.ontheroad.leanCloud.service;

import com.alibaba.fastjson.JSONObject;
import com.ontheroad.leanCloud.model.DeviceType;
import org.springframework.remoting.service.annotation.RemoteService;

import java.util.ArrayList;
import java.util.Map;

/**
 * 推送服务
 * Created by kedong on 2017/11/11 0011.
 */
@RemoteService
public interface LeanCloudService {
    /**
     * 获取AVOS APPID
     *
     * @return
     */
    String getAppId();

    /**
     * 获取AVOS APPKEY
     *
     * @return
     */
    String getAppKey();

    /**
     * 获取AVOD MASTERKEY
     *
     * @return
     */
    String getMasterKey();

    /**
     * 推送
     *
     * @param content
     * @param deviceType
     * @throws Exception
     */
    void push(String content, DeviceType deviceType, Map<String, Object> map) throws Exception;

    /**
     * 创建新的会话
     *
     * @param sessionName
     * @param userIds
     * @return
     * @throws Exception
     */
    String createSession(String sessionName, JSONObject json, ArrayList<Integer> userIds) throws Exception;

    void pushToInstallationId(Integer userId, Map<String, Object> map);

    /**
     * 添加用户到对话中
     *
     * @param objectId
     */
    Boolean addUserToSession(String objectId, Integer userId);

    /**
     * 从对话中删除用户
     *
     * @param objectId
     */
    Boolean removeUserFromSession(String objectId, Integer userId);
}
